@import '@devui/theme/styles-var/devui-var.scss';

.#{$devui-prefix}-image-preview {
  position: fixed;
  left: 0;
  top: 0;
  right: 0;
  bottom: 0;
  z-index: $devui-z-index-full-page-overlay;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;

  svg,
  polygon,
  g,
  path {
    fill: $devui-icon-text;
  }
  @mixin fixed-button() {
    position: fixed;
    z-index: $devui-z-index-full-page-overlay;
    cursor: pointer;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: none;
    background: $devui-highlight-overlay;
    box-shadow: $devui-shadow-length-base $devui-light-shadow;
    display: inline-flex;
    align-items: center;
    justify-content: center;

    &:hover {
      background: $devui-area;
    }

    svg {
      width: 38px;
      height: 18px;
    }
  }

  &__main-image {
    width: auto;
    height: auto;
    max-width: 90%;
    max-height: 90%;
    margin-top: -20px;
    cursor: grab;
  }

  &__close-btn {
    @include fixed-button();

    top: 15px;
    right: 20px;
  }

  &__arrow-left {
    @include fixed-button();

    top: 50%;
    left: 20px;
    transform: translateY(-50%);
  }

  &__arrow-right {
    @include fixed-button();

    top: 50%;
    right: 20px;
    transform: translateY(-50%);
  }

  &__toolbar {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: $devui-highlight-overlay;
    box-shadow: $devui-shadow-length-fullscreen-overlay $devui-light-shadow;

    button {
      display: inline-flex;
      width: 24px;
      height: 24px;
      align-items: center;
      justify-content: center;
      color: $devui-text;
      border: none;
      background-color: transparent;
      cursor: pointer;
      outline: 0;
      padding: 0;
    }

    .#{$devui-prefix}-image-preview__index {
      display: inline-flex;
      width: 100px;
      justify-content: center;
      align-items: center;
      cursor: pointer;
    }

    & > :not(:first-child) {
      margin-left: 20px;
    }
  }
}

.#{$devui-prefix}-image-preview__bg {
  position: fixed;
  left: 0;
  top: 0;
  right: 0;
  bottom: 0;
  z-index: calc($devui-z-index-full-page-overlay - 1);
  background: $devui-shadow;
  border-radius: $devui-border-radius;
  box-shadow: $devui-shadow-length-fullscreen-overlay $devui-shadow;
}
